import {Routes,Route} from 'react-router-dom'
import elements from './element'
import Author from './Author'
export default function ReactDOM(){
    return(
        <div>
          <Routes>
          {
            elements.map((item,index)=>{
                return <Route key={index} path={item.path} element={item.anthor?<Author oldComponent={item.element} oldPath={item.path}/>:item.element}>
                    {
                       item.children && item.children.map((two,i)=>{
                            return <Route key={i} path={two.path} element={two.anthor?<Author oldComponent={two.element} oldPath={item.path+'/'+two.path}/>:two.element}/>
                       })
                    }
                </Route>
           })
          }z
          </Routes>
        </div>
    )
}